<?php

namespace Medicina\BackendBundle\Form;

use Symfony\Component\Form\FormBuilder;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;
use \Medicina\KernelBundle\Entity\User;

class RegistrationFormType extends BaseType {
    
    public function buildForm(FormBuilder $builder, array $options) {
        parent::buildForm($builder, $options);
        $builder
        
                ->add('dni')
                ->add('apellido')
                ->add('nombre')
                ->add('email')
                ->add('telefono')
                ->add('direccion')
                ->add('codigopostal', 'text', array('label' => 'Codigo Postal'))
                ->add('oficina', null, array('empty_value' => 'Seleccione una Oficina'))
//                ->add('roles', 'choice', array(
//                    'choices' => array(
//                        'ROLE_ADMIN' => 'ROLE_ADMIN',
//                        'ROLE_USER' => 'ROLE_USER',
//                    ),
//                    'property_path' => false,
//                    'multiple' => true,
//                ))
                 ->add('roles', 'choice', array(
                    'choices' => User::getRolesSelect(),
                    'label' => 'Roles',
                    'property_path' => false,
                    'multiple' => true,
                ))
        ;
    }

    public function getName() {
        return 'backend_user_registration';
    }

}